<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>贵州文化历史网</title>
<!-- <meta name="keywords" content="个人博客,杨青个人博客,个人博客模板,杨青" />
<meta name="description" content="杨青个人博客，是一个站在web前端设计之路的女程序员个人网站，提供个人博客模板免费资源下载的个人原创网站。" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="__static__/home/css/base.css" rel="stylesheet">
<link href="__static__/home/css/about.css" rel="stylesheet">
<link href="__static__/home/css/m.css" rel="stylesheet">
<link  rel="stylesheet" href="__static__/pinglun/css/main.css" />
<link rel="stylesheet" type="text/css" href="__static__/pinglun/css/sinaFaceAndEffec.css" />
<script type="text/javascript" src="__static__/pinglun/js/jquery-1.8.3.min.js"></script>
<script>
window.onload = function ()
{
	var oH2 = document.getElementsByTagName("h2")[0];
	var oUl = document.getElementsByTagName("ul")[0];
	oH2.onclick = function ()
	{
		var style = oUl.style;
		style.display = style.display == "block" ? "none" : "block";
		oH2.className = style.display == "block" ? "open" : ""
	}
}
</script>
</head>
<body>
<header>
  {include file="./public/top"}
</header>
<article>
 <h2 class="litle"><span>幸福就是：雨天能为你撑起一把小伞；幸福就是：牵你的小手与你共度夕阳；幸福就是：你永远开心快乐！</span></h2>
 <div class="ab_box">
  <div class="leftbox">
      <div class="newsview">
        <div id="content" style="width: 700px; height: auto;margin-left:10px;margin-top:40px">
            <div class="wrap">
                <div class="comment">
                    <div class="head-face">
                        <img src="__static__/pinglun/images/1.jpg" />
                        <p>文明留言哦</p>
                    </div>
                    <div class="content">
                        <div class="cont-box">
                            <textarea class="text" id="mess" name="mess" placeholder="请输入..."></textarea>
                        </div>
                        <div class="tools-box">
                            <div class="operator-box-btn"><span class="face-icon">☺</span><span class="img-icon">▧</span></div>
                            <div class="submit-btn"><input type="submit" onclick="ti({$Request.session.userid})" value="提交评论" /></div>
                        </div>
                    </div>
                </div>
                <div id="info-show">
                    <ul>
                        {volist name="mess_user" id="mess_user"}
                        <li>
                            <div class="head-face">
                                <img src="__static__/pinglun/images/1.jpg" / >
                            </div>
                            <div class="reply-cont">
                                <p class="username">{$mess_user.name}</p>
                                <p class="comment-body">{$mess_user.content}</p>
                                {if condition="$mess_user.reply neq ''"}
                                <p class="comment-footer">回复内容:{$mess_user.reply}</p>
                                {else /}
                                {/if}
                                <p class="comment-footer">{$mess_user.create_time}	{if condition="$mess_user.user_id eq $Request.session.userid"}
                                 <button onclick="del({$mess_user.id})" style="border: none;background-color: transparent;outline: none;">删除</button>
                                 {else /}
                                 {/if}</p>
                            </div>
                        </li>
                        {/volist}
                    </ul>
                </div>
            </div>
        </div>
    </div>
  </div>
  <div class="rightbox">
    <div class="aboutme">
      <h2 class="hometitle">关于我</h2>
      <div class="avatar"> <img src="__static__/home/images/b04.jpg"> </div>
      <div class="ab_con">
 <p>网名：dancesmile | 兰艳</p>
        <p>职业：Web前端设计师、网页设计 </p>
        <p>个人微信：yangqq_1987</p>
        <p>邮箱：dancesmiling@qq.com</p>

      </div>
    </div>
    <div class="weixin">
      <h2 class="hometitle">官方微信</h2>
      <ul>
        <img src="__static__/home/images/wx.jpg">
      </ul>
    </div>
  </div>
 </div>
</article>
<script type="text/javascript" src="__static__/pinglun/js/main.js"></script>
<script type="text/javascript" src="__static__/pinglun/js/sinaFaceAndEffec.js"></script>

<script type="text/javascript" src="__static__/pinglun/js/main.js"></script>
    <script type="text/javascript" src="__static__/pinglun/js/sinaFaceAndEffec.js"></script>
    <script type="text/javascript">
        function ti(uid) {
            // layer.msg('1');
            var id = uid;
            var mess = $("#mess").val();
            var artresid = 0;
            $.ajax({
                type: 'post',
                url: "{:url('index/messages/add')}",
                data: { id: id, content: mess, artresid: artresid },
                dataType: 'json',
                success: function (res) {
                    if (res.code == 1) {
                        layer.msg(res.msg, { icon: 1, time: 1000 });
                        setTimeout(function () {
                            window.location.reload()
                        }, 1000)
                    } else if(res.code = 2){
                        layer.msg(res.msg , { icon: 5, time: 1000 });
                        setTimeout(function () {
                            window.location.href="{:url('index/admin/login')}";
                        }, 1000)
                    }else{
                        layer.msg(res.msg);
                    }
    
                },
                error: function (res) {
                    console.log(res.msg);
                },
            });
        }

        function del(id) {
          // var id = uid;
          $.ajax({
            type: 'post',
            url: "{:url('index/messages/del')}",
            data: { id: id},
            dataType: 'json',
            success: function (res) {
              if (res.code == 1) {
                layer.msg(res.msg, { icon: 1, time: 1000 });
                setTimeout(function () {
                  window.location.reload()
                }, 1000)
              } else if(res.code = 2){
                layer.msg(res.msg , { icon: 5, time: 1000 });
                setTimeout(function () {
                  window.location.href="{:url('index/admin/login')}";
                }, 1000)
              }

            },
            error: function (res) {
              console.log(res.msg);
            },
          });
        }
    </script>
<script type="text/javascript">
	// 绑定表情
	$('.face-icon').SinaEmotion($('.text'));
	// 测试本地解析
	function out() {
		var inputText = $('.text').val();
		$('#info-show ul').append(reply(AnalyticEmotion(inputText)));
	}
	
	var html;
	function reply(content){
		html  = '<li>';
		html += '<div class="head-face">';
		html += '<img src="__static__/pinglun/images/1.jpg" / >';
		html += '</div>';
		html += '<div class="reply-cont">';
		html += '<p class="username">小小红色飞机</p>';
		html += '<p class="comment-body">'+content+'</p>';
		html += '<p class="comment-footer">2016年10月5日　回复　点赞54　转发12</p>';
		html += '</div>';
		html += '</li>';
		return html;
	}
</script>
</body>
</html>
